home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / bg.arc / BG.DOC next >
Text File  |  1985-04-03  |  8KB  |  202 lines

  1.  
  2.  
  3.  
  4.  
  5.         DESCRIPTION:
  6.  
  7.              The command with which to invoke BG is:-
  8.  
  9.                              BG  [[d:]afn.ft]   [options]
  10.  
  11.              BG generates a file call NAMES.BAT.  It uses the command 
  12.              line to obtain the filename.filetype search mask (afn.ft 
  13.              portion)  and also  some  optional run time parameters.  
  14.              These  parameters are used to select  the  file names  off 
  15.              of  the specified disk.  These selected file names are then  
  16.              sorted into ascending sequence and the user is notified  of 
  17.              how many files are selected. 
  18.  
  19.              At  this  point  a prompt 'Skeleton?'  is  displayed  asking  
  20.              for skeleton  line(s)  into  which the selected file  names  
  21.              will  be inserted. More  than one skeleton line can be given 
  22.              in which case  multiple lines  are generated for each file 
  23.              name.  A null line  terminates the skeleton line input phase 
  24.              of the programs operation.
  25.  
  26.              Obviously,  part of the skeleton can be commands that 
  27.              operate  on the file names.  Alternatively, BATCH parameters 
  28.              can be included at  various  points  within the skeleton if 
  29.              it  is  necessary  to generate a multi-use .BAT file.
  30.  
  31.         SUBSTITUTION FORMULA:
  32.  
  33.              During  the  generation of the .BAT file from the  selected  
  34.              file names  BG copies the skeleton line(s) to the output 
  35.              file once for every selected name. During this copying 
  36.              process BG looks for occurrences of the substitution 
  37.              character. When found, BG replaces this character with the 
  38.              current  filename.filetype.  The standard  character  is  
  39.              the '@' character 
  40.  
  41.              Special  processing  is  done by BG if  the  @  character  
  42.              is preceded  or  followed  by a period.  This is to  allow  
  43.              for  the possibility  of  doing  global  operations  on  
  44.              filetypes  or  on systems.  The  algorithm  is  most  easily 
  45.              explained  by  use  of examples. Assume that the current 
  46.              file name is ABC.COM. Thus:-
  47.  
  48.              erase @          => erase ABC.COM      ;simple case first
  49.  
  50.              erase b:@        => erase b:ABC.COM    ;another simple case
  51.  
  52.              rename  @ @.old  => rename ABC.COM  ABC.old
  53.                                                     ; . suffix causes fn
  54.                                                       substitution only
  55.  
  56.              dir *.@          => dir *              ; . prefix causes ft
  57.                                                     ;  substitution only
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.              A  secondary  substitution  character  has  been  provided   
  72.              that functions  just as above with one exception,  when 
  73.              selecting only fn  or  ft  by  specification of a period  
  74.              before  or  after  the substitution  character,  a  leading 
  75.              or trailing  period  is  not written to the output file.   
  76.              The standard secondary substitution character is the '#'.  
  77.              Expanding upon the above example, we have:
  78.  
  79.              testpgm #.  => testpgm ABC         ; no trailing period
  80.  
  81.              type #      => type ABC.CO         ; identical to standard 
  82.                                                 ; substitution character
  83.                                                 ; if no leading or 
  84.                                                 ; trailing period
  85.  
  86.  
  87.         OPTIONAL EXTRAS:
  88.  
  89.              The following options can follow the file name specification 
  90.              if these additional capabilities are desired:
  91.  
  92.              (F)  This option allows specification of an output file name 
  93.                   following the options prompt.  If this option is not 
  94.                   used, the default output file name is NAMES.BAT.
  95.  
  96.              (H)  This causes a Header?  prompt to be written.  It is 
  97.                   used to write  one or more records to the output file 
  98.                   before the body  of the file is written using the 
  99.                   skeleton definitions.  No file name substitution takes 
  100.                   place on these header records.   A null  reply 
  101.                   terminates the header record writing process.
  102.  
  103.              (L)  This  option is used to convert all file names to lower 
  104.                   case before substitution into the skeleton lines.  This 
  105.                   option is very useful with the C86 librarian and 
  106.                   linker, as they are a bit confused about the case of 
  107.                   file names.  i.e. The librarian is case sensitive, but 
  108.                   the linker is not.
  109.  
  110.              (P)  This causes the selected filenames to be written 
  111.                   followed by a  question  mark (?) during the selection 
  112.                   process.  This  occurs after selection, i.e. you have 
  113.                   the last say.  A Y response selects the file while an N 
  114.                   response rejects the file.  In addition, a B response 
  115.                   backs up one entry in the list, a S response skips the 
  116.                   rest of the list, and a Q response immediately aborts 
  117.                   BG.
  118.  
  119.              (T)  Similar to the Header option,  the trailer option 
  120.                   allows one or more records to be written after the body 
  121.                   of the file.
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.         HELP:
  138.  
  139.              BG has a simple help function to jog your memory if you 
  140.              forget how some of the parameters work, it is invoked by 
  141.              typing:
  142.  
  143.                             BG ?
  144.  
  145.         EXAMPLES:
  146.  
  147.              Note:  In  these  examples the UPPER CASE represents  user  
  148.              input except where obviously not user input.
  149.  
  150.              1.   Rename all .BAK files on the default drive to .ASM.
  151.  
  152.                   C>BG *.BAK                   Invoke BG
  153.                   BG-......                    Normal identifier from BG
  154.                   There are 10 selected files  BGs msg
  155.                   Skeleton?RENAME @ @.ASM      Refer to substitution rules.
  156.                   Skeleton?                    Null reply
  157.  
  158.                   C>NAMES                      Now do the renames.
  159.  
  160.              2.   You are about to undertake the BG v2 project. Rename 
  161.                   all existing BG10.* components (DOC, REL, COM, BAT and 
  162.                   whatever you have forgotton about) to this new name on 
  163.                   the A drive.
  164.  
  165.                   C>BG A:BG10.*                Invoke BG
  166.                   BG-......                    Normal identifier from BG
  167.                   There are 7 selected files   BGs msg
  168.                   Skeleton?RENAME  @ A:BG20.@  Make use of substitution 
  169.                                                rules
  170.                   Skeleton?                    Null reply
  171.  
  172.                   C>NAMES                      Now do the rename
  173.  
  174.              3.   You have to ERASE all your .BAK files on the default 
  175.                   drive. You wish to confirm each deletion.
  176.  
  177.                   C>BG *.BAK P                 Invoke BG with the P - option
  178.                   BG-......                    Normal identifier from BG
  179.                   mast.bak?N                   BG prompt - reject reply
  180.                   mast.bak?Y                   Select this one
  181.                    ....                        etc
  182.                   There are 2 selected files   BGs msg
  183.                   Skeleton?ERASE @             Generate the command
  184.                   Skeleton?                    Null reply
  185.  
  186.                   C>NAMES                      Invoke the command.
  187.  
  188.                   Now, you are ready, CHARGE!
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.